#ifndef MAINWINDOWCFGPARSER_H
#define MAINWINDOWCFGPARSER_H

#include <QObject>
#include <QString>
class MainWindow;
class QDomElement;
class QMenuBar;
class QMenu;
class QAction;
class QToolBar;
class QDomDocument;

class MainWindowCfgParser : public QObject
{
    Q_OBJECT
public:
    explicit MainWindowCfgParser(QObject *parent = 0);

    //Parse config file and generate UI
    MainWindow* parse(QString strCfgFilePath);
signals:

public slots:

protected:
    //Parse root(form) element of XML config file
    MainWindow*  parseFormElement(const QDomElement &element);

    //Parse menubar element
    QMenuBar* parseMenuBarElement(const QDomElement &element);

    //Parse menu element : recursive called
    QMenu* parseMenuElement(const QDomElement &element);

    //Parse action element
    QAction* parseActionElement(const QDomElement &element);

    //Parse tool element
    QToolBar* parseToolBarElement(const QDomElement &element);

private:
    MainWindow*            m_pMainWindow;                  //MainWindow generated by CVVP_FormConfigParser
    QString                m_strCfgFilePath;               //FormConfig file path

};

#endif // MAINWINDOWCFGPARSER_H
